<?php
include_once("../module/checkA.php");
include_once("../../config.php"); 
$plate=select_one_line_all_items($table_Prefix."plate","mid = 'finance'");
?>


<?

//用来判断当前系统属于什么板块
$system_part = $plate['mid'];
include_once("select_datas.php");
?>

<?$department_list=select_lines_all_items($table_Prefix."department","nid desc","","0");?>
<?$employee_list=select_lines_all_items($table_Prefix."employee","nid desc","","0");

$new_employee_list=transform_2darray_in_1darray_with_new_key($employee_list,"nid","name");


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include_once(ROOT_PATH_.'/controlbase/module/head.php'); ?>
</head>

<body>

<div id="topbar">
    <?php include ROOT_PATH_ . '/controller/common/module/topbar.php'; ?>
</div>

<div id="container" class="finance">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_ . '/controller/common/module/sidebar.php'; ?>
        </div>


    <div id="content">
        <?php $page_title='财务信息';?>
        <?php include ROOT_PATH_.'/controlbase/module/mod-page-title.php'; ?>








    <div class="select-box clearfix layui-form">
        <form action="detail-list.php?nav-itemed=order" >

            <div class="layui-form-item">
                <label class="layui-form-label">关键词</label>
                <div class="layui-input-block">
                    <input type="text" name="select_keywords" placeholder="可搜索名称" autocomplete="off" class="layui-input" value="<? echo $_REQUEST['select_keywords']?>" >
                </div>
            </div>

            <button class="layui-btn layui-btn-sm" ><i class="layui-icon">&#xe615;</i> 查找</button>

            <a class="layui-btn white layui-btn-sm" href="<?echo $domain?>/controlbase/goods/detail-list.php?nav-itemed=menu" ><i class="layui-icon">&#x1006;</i> 重置</a>

            <br class="clearfloat"/>
        </form>




    </div>



            <div class="statistic">

                <button class="layui-btn layui-btn-sm" id="quanxuan"><i class="layui-icon">&#x1005;</i>全选</button>
                <button class="layui-btn layui-btn-sm" id="buxuan"><i class="layui-icon">&#xe63f;</i>不选</button>

                <a class="layui-btn layui-btn-sm" href="collect.php?now_extender=<?php echo $system_part?>"><i class="fa fa-bar-chart-o" aria-hidden="true"></i>  统计</a>
                <a class="layui-btn layui-btn-sm" href="detail-add.php?nav-itemed=unit&now_extender=<?php echo $system_part?>"><i class="layui-icon">&#xe608;</i>  新增</a>


                <a class="layui-btn all_qcode" style="display:none;" href="erweima_all_list.php?nav-itemed=unit&now_extender=<?php echo $system_part?>"><i class="layui-icon">&#xe64a;</i>  二维码批量生成</a>

                <div class="function">

                    <div class="sort layui-form">
                        <div class="layui-form-item" style="margin-bottom:5px;">
                            <label class="layui-form-label">排序：</label>
                            <div class="layui-input-block">
                                <select lay-filter="MM_jumpMenu" >
                                    <option <?php if($sortby == ''){echo 'selected="selected"';}?>  value="detail-list.php?nowpageid=<?php echo $nowpageid; ?>&nid=<? echo $trans_nid ?>&sortby=listorder&now_extender=<? echo $system_part ?>">排序选择</option>
                                    <option <?php if($sortby == 'listorder' && $sortorder == 'desc'){echo 'selected="selected"';}?> value="detail-list.php?nowpageid=<?php echo $nowpageid; ?>&nid=<? echo $trans_nid ?>&sortby=listorder&sortorder=desc&now_extender=<? echo $system_part ?>">人工排序降序</option>
                                    <option <?php if($sortby == 'listorder' && $sortorder == 'asc'){echo 'selected="selected"';}?> value="detail-list.php?nowpageid=<?php echo $nowpageid; ?>&nid=<? echo $trans_nid ?>&sortby=listorder&sortorder=asc&now_extender=<? echo $system_part ?>">人工排序升序</option>
                                    <option <?php if($sortby == 'nid' && $sortorder == 'desc'){echo 'selected="selected"';}?> value="detail-list.php?nowpageid=<?php echo $nowpageid; ?>&nid=<? echo $trans_nid ?>&sortby=nid&sortorder=desc&now_extender=<? echo $system_part ?>">输入时间降序</option>
                                    <option <?php if($sortby == 'nid' && $sortorder == 'asc'){echo 'selected="selected"';}?> value="detail-list.php?nowpageid=<?php echo $nowpageid; ?>&nid=<? echo $trans_nid ?>&sortby=nid&sortorder=asc&now_extender=<? echo $system_part ?>">输入时间升序</option>
                                    <option <?php if($sortby == 'name' && $sortorder == 'desc'){echo 'selected="selected"';}?> value="detail-list.php?nowpageid=<?php echo $nowpageid; ?>&nid=<? echo $trans_nid ?>&sortby=name&sortorder=desc&now_extender=<? echo $system_part ?>">资料名称升序</option>
                                    <option <?php if($sortby == 'name' && $sortorder == 'asc'){echo 'selected="selected"';}?> value="detail-list.php?nowpageid=<?php echo $nowpageid; ?>&nid=<? echo $trans_nid ?>&sortby=name&sortorder=asc&now_extender=<? echo $system_part ?>">资料名称降序</option>
                                </select>
                            </div>
                        </div>
                    </div>


                </div>


                <hr/>
            </div>



            <br class="clearfloat"/>






<!-- 用$system_part .list_boxes来控制来到确认板块信息显示-->
<div class="list-box">
<div class="list-boxes layui-form">


<table class="layui-table">
  <colgroup>
    <col width="100">
    <col width="150">
	<col > 
	<col > 
	<col > 
	<col > 
	<col >
      <col width="200">
	<col width="75">
	<col width="200">
	<col width="290">
  </colgroup>



        <thead>
    <tr>

      <th><span onclick="quanxuan()">全选 </span>序号</th>
      <th>内容</th>
      <th>金额</th>
      <th>用款人</th>
      <th>部门</th>
      <th>录入</th>
      <th>类型</th>
      <th>日期</th>
      <th>状态</th>
      <th>备注</th>
      <th>操作</th>
    </tr> 
  </thead>
  <tbody>


  <?php

 
  if ($detailnum == 0) {
      echo "数据添加中";
  }

  ?>

  <?php
	for ($i = 0; $i < $detailnum; $i++) {
    ?>
        <!--//查看这条信息有无修改申请，有的话就变色，提示修改中-->
        <? $applymodify=select_one_line_all_items($table_Prefix."finance","rid='".$detail[$i]['nid']."' and applystatus='申请修改'") ;?>


<tr id="item<?echo $detail[$i]['nid']?>" <?if($applymodify['nid']){echo "style='color:red'";$status=" / 审核中";}else{$status="";}?>>

      <td>

          <?if(!$applymodify['nid']){?>



          <input name="plguozhang[<?echo $i?>]" type="checkbox" value="<?echo $detail[$i]['nid']?>"><?echo $i+1+$plate['page_list_num']*($nowpageid-1) ?>

              <?;}?></td>

      <td><?echo $detail[$i]['name']?></td>
      <td><?echo $detail[$i]['cost']?></td>
      <td><?echo $new_employee_list[$detail[$i]['principal']]?></td>


      <? $department=select_one_line_all_items($table_Prefix."department","nid = '".$detail[$i]['departmentid']."'")?>
	  <td><?echo $department['name']?></td>

        <? $authurname=select_one_line_all_items($table_Prefix."employee","nid = '".$detail[$i]['authur']."'")?>
        <td><?echo $authurname['name']?></td>
	  <td><?echo $detail[$i]['classify']?></td>
	  <td><?echo $detail[$i]['applydate']?></td>
	  <td> <?echo $detail[$i]['status']?></td>
    <td >
        <? if(($detail[$i]['remark'])and($detail[$i]['remark']!="  ")){ ?>
            <span id="reamrk_<?php echo $detail[$i]['nid']?>" onmouseover="show_remark ('<?php echo $detail[$i]['remark']?>','reamrk_<?php echo $detail[$i]['nid']?>')" >
              <?
              $conditon['str']=$detail[$i]['remark'];
              $conditon['len']=8;
              $conditon['from']=0;
              echo utf8_substr($conditon)."..."?></span>
            <?;}?>

    </td>


	  <td>






<a href="detail-edit.php?nav-itemed=<?echo $system_part?>&nid=<? echo $detail[$i]['nid']?>&nowpageid=<?echo $nowpageid?>"
class="layui-btn layui-btn-sm" >
<i class="layui-icon">&#xe642;</i>修改</a>



<?if($detail[$i]['status']!="过账"){?>
<a href="javascript:void(0)" onclick="delItem (<?php echo $detail[$i]['nid']?>)"
class="delete layui-btn  layui-btn-sm" >
<i class="layui-icon">&#xe640;</i> 删除 </a>
<?}?>


<!--href="detail-verify-status.php?nav-itemed=--><?//echo $system_part?><!--&nid=--><?// echo $detail[$i]['nid']?><!--&status=--><?//echo $detail[$i]['status']?><!--&nowpageid=--><?//echo $nowpageid?><!--"-->


<?if($_SESSION['position']=="出纳"){?>
<a
href="javascript:void(0)"
class="layui-btn  layui-btn-sm"
id         ="counter<? echo $detail[$i]['nid'] ?>"
date-id    ="<? echo $detail[$i]['nid'] ?>"
date-status="<? echo $detail[$i]['status'] ?>"
onclick    ="show_message_layer();finance_status('counter'+<? echo $detail[$i]['nid'] ?>)"
>
<?
if($detail[$i]['status']!="过账"){echo "过账";}
else{echo "取消过账";}
?>
</a>
<?}?>




              <? if((($_SESSION['mid']=="admin")||($_SESSION['mid']=="finance"))&&($applymodify['nid'])){ ;?>
                  <a href="detail-verify.php?nav-itemed=<?echo $system_part?>&nid=<? echo $detail[$i]['nid']?>" class="layui-btn  layui-btn-sm">审核修改</a>
                  <?;}?>






  </td> 
    </tr>
  <?php

}
?>

 
  </tbody>
</table>






</div>


<div class="list-box-function" <? if ($detailnum == 0) {
    echo "style" . "='display:none'";
} ?> >
    <div class="page-guide">

        <?php
        if ($nowpageid == 1) {
            ?>
            <!--现在页数在第一页的时候-->
            <span>首页</span>
            <span>前一页</span>
            <!--现在页数非第一页的时候-->
        <?php
        } else {
            ?>
            <!--现在页数非第一页的时候-->
            <a href="detail-list.php?sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&now_extender=<? echo $system_part ?>&nav-itemed=<?echo $_GET[">首页</a>
            <a href="detail-list.php?nowpageid=<?php echo $prepage; ?>&sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&now_extender=<? echo $system_part ?>&nav-itemed=<?echo $_GET[">前一页</a>
            <!--现在页数非第一页的时候-->
        <?php
        }
        ?>


        <!--开始列印出所有页码-->

        <?php
        $ii = 1;
        $iii = 1;

        while ($ii <= $page_count) {
            //首先判断是不是当前页

            if ($ii == $nowpageid) {
                echo "<span>" . $ii . "</span>";
            } else if ((($ii + 5) < $nowpageid) || (($ii - 5) > $nowpageid)) {
            } else {
                echo "<a href='";
                echo "detail-list.php?nowpageid=";
                echo $iii;
                echo "&sortby=";
                echo $sort_by;
                echo "&nid=";
                echo $trans_nid;
                echo "&now_extender=";
                echo $system_part;
                echo $url_str;
                echo "&nav-itemed=";
                echo $_GET['nav-itemed'];
                echo "'>";
                echo $iii;
                echo "</a>";
            }

            $ii++;
            $iii++;
        }
        ?>

        <!--列印出所有页码 结束-->


        <?php
        if ($nowpageid == $page_count) {
            ?>
            <!--现在页数在第一页的时候-->
            <span>后一页</span>
            <span>末页</span>
            <!--现在页数非第一页的时候-->
        <?php
        } else {
            ?>
            <!--现在页数非第一页的时候-->
            <a href="detail-list.php?nowpageid=<?php echo $nextpage; ?>&sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&now_extender=<? echo $system_part ?>&nav-itemed=<?echo $_GET[">后一页</a>
            <a href="detail-list.php?nowpageid=<?php echo $lastpage; ?>&sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&now_extender=<? echo $system_part ?>&nav-itemed=<?echo $_GET[">末页</a>
            <!--现在页数非第一页的时候-->
        <?php
        }
        ?>


    </div>
    <!--翻页代码结束-->
</div>


<!--list-boxes end-->
</div>
<!--list-box end-->
</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>

















<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>




</body>
</html>

 pt>